package com.gitee.wsl.ext.number


/**
 * This value as an integer if this value is not null, or zero otherwise.
 */
inline val Number?.orZeroInt: Int
    get() = this?.toInt() ?: 0

/**
 * This value as an integer if this value is not null, or zero otherwise.
 */
inline val Float?.orZero: Float
    get() = this ?: 0f

/**
 * This value as an integer if this value is not null, or zero otherwise.
 */
inline val Int?.orZero: Int
    get() = this ?: 0

/**
 * This value as an integer if this value is not null, or zero otherwise.
 */
inline val Double?.orZero: Double
    get() = this ?: 0.0